<template>
  <div class="container">
    <el-card shadow="always">
      <el-row :gutter="20">
        <el-col :span="4">
          <el-select
            v-model="query.checkdatetime"
            placeholder="请选择职位状态"
            :clearable="false"
          >
            <el-option
              v-for="item in ['2021','2022','2023']"
              :key="item"
              :label="item"
              :value="item"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="2">
          <el-button
            type="primary"
            @click="
              query.pageIndex = 1;
              getList();
            "
            >搜索</el-button
          >
        </el-col>
      </el-row>
      <rz-height></rz-height>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="checkdatetimeStr" label="检查日期" width="100">
        </el-table-column>
        <el-table-column label="检查结果" prop="checkresultStr" width="100">
        </el-table-column>
        <el-table-column prop="checkResultDeal" label="处理结果">
        </el-table-column>
        <el-table-column prop="lhdf" label="量化得分" width="100">
        </el-table-column>
        <el-table-column
          prop="rcjgUnitName"
          label="检查部门"
          width="250"
        ></el-table-column>
        <el-table-column
          prop="supervisorNames"
          label="检查人"
          width="180"
        ></el-table-column>
        <el-table-column label="查看" width="100">
          <template slot-scope="scope">
            <el-button type="primary" size="mini" @click="score(scope.row)"
              >查看</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <pagination
        :total="total"
        @pagination="getList"
        :page.sync="query.pageIndex"
      />


  <rz-dialog
        :dialogVisible.sync="dialogVisible"
        :isShowConfirm="false"
        title="查看日常监督记录详情"
      >
  <el-tabs v-model="activeName">
    <el-tab-pane label="检查结果" name="1">
          <el-form label-width="120px" :model="from">


           <el-row>
          <el-col :span="12">
            <el-form-item label="检查日期">  {{from.checkdatetimeStr}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检查结果">{{from.checkresultStr}}</el-form-item>
          </el-col>
        </el-row>
           <el-row>
          <el-col :span="24">
            <el-form-item label="处理结果">  {{from.checkResultDeal}}</el-form-item>
          </el-col>
   
        </el-row>
           <el-row>
          <el-col :span="12">
            <el-form-item label="检查部门">  {{from.rcjgUnitName}}</el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="检查人">{{from.supervisorNames}}</el-form-item>
          </el-col>
        </el-row>
           <el-row>
          <el-col :span="24">
            <el-form-item label="说明">  {{from.remarks|filterHtml}}</el-form-item>
          </el-col>
      
        </el-row>
        </el-form>
    </el-tab-pane>
        <el-tab-pane label="检查详情" name="2">
 <div v-for="item in list" :key="item.checkItemId">
    <rz-height/>
  <rz-height/>
  <div class="title center">{{item.checkItemName}}</div>
  <rz-height/>
  <rz-height/>
  <el-table :data="item.dailyCheckDetailsSubItemResponseList" border style="width: 100%">
        <el-table-column prop="itemNo" label="序号" width="100">
        </el-table-column>
        <el-table-column label="检查内容" prop="itemContent" >
        </el-table-column>
    <el-table-column label="检查结果" prop="itemContent" width="100">
                       <template slot-scope="scope">
                          {{scope.row.checkResult==1?'是':'否'}}
          </template>
        </el-table-column>
  </el-table>
  <height/>
  <height/>

 </div>
 </el-tab-pane>
    


  </el-tabs>

    

  </rz-dialog>
    </el-card>
  </div>
</template>
<script>
import { findDailySupervision } from "@/api/modules/enterprise";
import { findDailyCheckResultByUnitNameAndCheckFormNo } from "@/api/modules/interpretation";
export default {
  // props:[],
  // 页面加载
  created() {
    this.getList();
  },
  // 页面加载完成
  mounted() {},
  //实例销毁之前
  beforeDestroy() {},
  //实例销毁后
  destroyed() {},
  data() {
    return {
      activeName:"1",
      query: {
        id: "",
        pageIndex: 1,
        pageSize: 10,
        unId: sessionStorage.getItem("interpretation"),
        checkdatetime: "2023",
        licenseno: "",
      },
      tableData: [],
      total: 0,
      dialogVisible: false,
      from: {},
      list:[]
    };
  },
  // 方法
  methods: {
    getList() {
      findDailySupervision(this.query).then((res) => {
        this.tableData = res.data.list;
        this.total = res.totalCount;
  
        
      });
    },
    score(e) {
      // console.log(e);
      this.from=e
      this.dialogVisible=true
  
      findDailyCheckResultByUnitNameAndCheckFormNo({
        checkFormNo:e.checkFormNo,
        	unitName: e.checkUnitName
      }).then((res) => {
        this.list=res.data[0].dailyCheckDetailsHandleResponseList
    
  })
    },
  },
  // 监听属性
  watch: {},
  // 组件
  components: {},
  // 计算属性
  computed: {},
};
</script>

<style lang="scss" scoped>
.icon-erweima {
  font-size: 40px;
}
.title{
  font-weight: 700;
  font-size:18px;
}
</style>
